package com.github.chain.admin.server.service;

import com.github.chain.admin.common.domain.Menu;
import com.github.chain.admin.common.domain.Role;
import com.github.chain.admin.common.domain.RoleMenu;
import com.github.chain.admin.common.domain.User;
import com.github.framework.core.page.DataPage;
import com.github.chain.admin.common.request.RoleRequest;
import com.github.framework.core.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Set;


public interface RoleService {

    /**
     * 根据用户id查询对应的角色
     * @param userId
     * @return
     */
    Result<Boolean> findRoleByUserId(Long userId);

    Result<Set<Role>> findRolePermissionsByUserId(Long userId);

    //Result<DataPage<Role>> finRoleByPage(RoleRequest roleRequest);

    Result<DataPage<Role>> findRoleByPage(RoleRequest request);

    Result<Role> findRoleById(Long id);

    Result<Integer> updateRole(RoleRequest roleRequest);

    Result<Integer> deleteRoleById(Long id);

    Result<Integer> deleteRoleListById(List<Long> ids);

    Result saveRole(RoleRequest roleRequest);

    Result authPermissions(RoleMenu roleMenu);

    Result<List<User>> findUserByRoleId(Long id);

    Result enableRoleStatus(List<Long> ids);

    Result disableRoleStatus(List<Long> ids);
}
